<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of generate_mjd</title>
  <meta name="keywords" content="generate_mjd">
  <meta name="description" content="--------------------------------------------------------------">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html v1.5 &copy; 2003-2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../index.html">Home</a> &gt;  <a href="index.html">fvcom_prepro</a> &gt; generate_mjd.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for fvcom_prepro&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>-->

<h1>generate_mjd
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>--------------------------------------------------------------</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>This is a script file. </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment">--------------------------------------------------------------
 dump to netcdf file
--------------------------------------------------------------</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
<!-- crossreference -->



<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <span class="comment">%--------------------------------------------------------------</span>
0002 <span class="comment">% dump to netcdf file</span>
0003 <span class="comment">%--------------------------------------------------------------</span>
0004 
0005 start_day = greg2mjulian(2007,4,1,1,0,0);
0006 end_day   = greg2mjulian(2007,7,1,0,0,0);
0007 
0008 time = start_day:(1./24):end_day;
0009 
0010 <span class="comment">% open boundary forcing</span>
0011 nc = netcdf(<span class="string">'gom1v10_decelles_2007_time.nc'</span>, <span class="string">'clobber'</span>);       
0012 
0013 
0014 <span class="comment">% dimensions</span>
0015 nc(<span class="string">'time'</span>) = 0; 
0016 
0017 <span class="comment">% variables</span>
0018 nc{<span class="string">'time'</span>} = ncfloat(<span class="string">'time'</span>);
0019 nc{<span class="string">'time'</span>}.long_name = <span class="string">'time'</span>;  
0020 nc{<span class="string">'time'</span>}.units     = <span class="string">'days since 0.0'</span>;  
0021 nc{<span class="string">'time'</span>}.time_zone = <span class="string">'none'</span>;  
0022 
0023 nc{<span class="string">'Itime'</span>} = ncint(<span class="string">'time'</span>);
0024 nc{<span class="string">'Itime'</span>}.units     = <span class="string">'days since 0.0'</span>;  
0025 nc{<span class="string">'Itime'</span>}.time_zone = <span class="string">'none'</span>;  
0026 
0027 nc{<span class="string">'Itime2'</span>} = ncint(<span class="string">'time'</span>);
0028 nc{<span class="string">'Itime2'</span>}.units     = <span class="string">'msec since 00:00:00'</span>;
0029 nc{<span class="string">'Itime2'</span>}.time_zone = <span class="string">'none'</span>;  
0030 
0031 
0032 <span class="comment">% dump dynamic data</span>
0033 ntimes = numel(time);
0034 nc{<span class="string">'time'</span>}(1:ntimes) = time(1:ntimes);
0035 nc{<span class="string">'Itime'</span>}(1:ntimes) = floor(time(1:ntimes));
0036 nc{<span class="string">'Itime2'</span>}(1:ntimes) = mod(time(1:ntimes),1)*24*3600*1000.;
0037 
0038 nc = close(nc);    
0039 
0040</pre></div>
<hr><address>Generated on Wed 02-Nov-2011 21:58:00 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>